home *** CD-ROM | disk | FTP | other *** search
/ Scene 96 / Scene 96 International Edition (Zyklop Software) (Disc 2) (1997).iso / misc / coding / midas060 / src / vu.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-16  |  3.7 KB  |  152 lines

  1. /*      VU.H
  2.  *
  3.  * Real VU meter routines
  4.  *
  5.  * $Id: vu.h,v 1.2 1997/01/16 18:41:59 pekangas Exp $
  6.  *
  7.  * Copyright 1996,1997 Housemarque Inc.
  8.  *
  9.  * This file is part of the MIDAS Sound System, and may only be
  10.  * used, modified and distributed under the terms of the MIDAS
  11.  * Sound System license, LICENSE.TXT. By continuing to use,
  12.  * modify or distribute this file you indicate that you have
  13.  * read the license and understand and accept it fully.
  14. */
  15.  
  16. #ifndef __VU_H
  17. #define __VU_H
  18.  
  19.  
  20.  
  21.  
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25.  
  26.  
  27.  
  28. /****************************************************************************\
  29. *
  30. * Function:     int vuInit(void);
  31. *
  32. * Description:  Initializes VU-meters, allocating room for MAXSAMPLES
  33. *               samples.
  34. *
  35. * Returns:      MIDAS error code
  36. *
  37. \****************************************************************************/
  38.  
  39. int CALLING vuInit(void);
  40.  
  41.  
  42.  
  43.  
  44. /****************************************************************************\
  45. *
  46. * Function:     int vuClose(void);
  47. *
  48. * Description:  Uninitializes VU-meters
  49. *
  50. * Returns:      MIDAS error code
  51. *
  52. \****************************************************************************/
  53.  
  54. int CALLING vuClose(void);
  55.  
  56.  
  57.  
  58.  
  59. /****************************************************************************\
  60. *
  61. * Function:     int vuPrepare(sdSample *sample, unsigned sampleNumber);
  62. *
  63. * Description:  Prepares the VU information for a sample
  64. *
  65. * Input:        sdSample *sample        pointer to Sound Device sample
  66. *                                       structure for this sample
  67. *               unsigned sampleNumber   sample number (0 - (MAXSAMPLES-1)),
  68. *                                       usually sound device sample handle
  69. *
  70. * Returns:      MIDAS error code.
  71. *
  72. \****************************************************************************/
  73.  
  74. int CALLING vuPrepare(sdSample *sample, unsigned sampleNumber);
  75.  
  76.  
  77.  
  78.  
  79. /****************************************************************************\
  80. *
  81. * Function:     int vuRemove(unsigned sampleNumber);
  82. *
  83. * Description:  Removes and deallocates the VU information for a sample
  84. *
  85. * Input:        unsigned sampleNumbe    sample number
  86. *
  87. * Returns:      MIDAS error code
  88. *
  89. \****************************************************************************/
  90.  
  91. int CALLING vuRemove(unsigned sampleNumber);
  92.  
  93.  
  94.  
  95.  
  96. /****************************************************************************\
  97. *
  98. * Function:     int vuMeter(unsigned sampleNumber, ulong rate,
  99. *                   unsigned position, unsigned volume, unsigned *meter);
  100. *
  101. * Description:  Calculates the VU-meter value (0-64) for the next 1/50th of
  102. *               a second
  103. *
  104. * Input:        unsigned sampleNumber   sample number
  105. *               ulong rate              playing rate
  106. *               unsigned position       sample playing position
  107. *               unsigned volume         playing volume (0-64)
  108. *               unsigned *meter         pointer to VU-meter value
  109. *
  110. * Returns:      MIDAS error code.
  111. *               VU-meter value (0-64) is stored in *meter
  112. *
  113. \****************************************************************************/
  114.  
  115. int CALLING vuMeter(unsigned sampleNumber, ulong rate, unsigned position,
  116.     unsigned volume, unsigned *meter);
  117.  
  118.  
  119. #ifdef __cplusplus
  120. }
  121. #endif
  122.  
  123.  
  124.  
  125. /****************************************************************************\
  126. *       enum vuFunctIDs
  127. *       ---------------
  128. * Description:  ID numbers for real VU-meter functions
  129. \****************************************************************************/
  130.  
  131. enum vuFunctIDs
  132. {
  133.     ID_vuInit = ID_vu,
  134.     ID_vuClose,
  135.     ID_vuPrepare,
  136.     ID_vuRemove,
  137.     ID_vuMeter
  138. };
  139.  
  140.  
  141. #endif
  142.  
  143.  
  144. /*
  145.  * $Log: vu.h,v $
  146.  * Revision 1.2  1997/01/16 18:41:59  pekangas
  147.  * Changed copyright messages to Housemarque
  148.  *
  149.  * Revision 1.1  1996/05/22 20:49:33  pekangas
  150.  * Initial revision
  151.  *
  152. */